export function dateToString (next) {
  const curDate = new Date()
  const nextDate = new Date(curDate.getTime() + 24 * 60 * 60 * 1000 * next)
  return nextDate.toJSON().substring(0, 10)
}

export function dateTimeToString (next) {
  const curDate = new Date()
  const nextDate = new Date(curDate.getTime() + 24 * 60 * 60 * 1000 * next)
  return nextDate.toJSON().substring(0, 19).replaceAll('T', ' ')
}

export function dateToNext (next) {
  const curDate = new Date()
  const nextDate = new Date(curDate.getTime() + 24 * 60 * 60 * 1000 * next)
  return nextDate
}

export function dToS (date) {
  date.setMinutes(date.getMinutes() - date.getTimezoneOffset())
  return date.toJSON().substring(0, 10)
}
